package com.simple.framework.security.custom;

import com.simple.common.core.domain.R;
import org.springframework.security.authentication.AbstractAuthenticationToken;

import java.util.LinkedList;

public class LoginFailToken extends AbstractAuthenticationToken {
    private R failResult;
    public LoginFailToken() {
        super(new LinkedList<>());
        setAuthenticated(false);
    }

    @Override
    public Object getCredentials() {
        return null;
    }

    @Override
    public Object getPrincipal() {
        return null;
    }

    public R getFailResult() {
        return failResult;
    }

    public void setFailResult(String msg) {
        this.failResult = R.fail(500, msg);
    }

    public void setFailResult(Integer code,String msg) {
        this.failResult = R.fail(code, msg);
    }
    public void setFailResult(Integer code,String msg,Object data) {
        this.failResult = R.fail(data);
    }

}
